import 'package:dio/dio.dart';
import 'package:date_format/date_format.dart';
List incomeData = [];
DateTime incomeDate = DateTime.now();
double totalIncome = 0;
getTotalIncome()async{
  totalIncome = 0;
  Response res = await Dio().post("http://123.207.114.127:1314/income/selectByDate",queryParameters: {
    'incomemonth': '${formatDate(incomeDate, [mm])}',
    'incomeyear':  '${formatDate(incomeDate, [yyyy])}'
  });
  for(int i=0;i<res.data.length;i++){
    totalIncome = totalIncome + res.data[i]['income'];
  }
}